<?php
include_once 'common/common.function.php';
include_once 'common/database.class.php';
?>
<?php 
if(!empty($_POST['submit'])){
	$TypeName = addslashes($_POST['type_name']);
	$TypeDesc = addslashes($_POST['type_desc']);
	if($TypeDesc=='' || $TypeName == ''){
		echo '内容不能为空';
		header('location:server_type_add.php');
		exit;
	}
	$CreateTime = time();
	$sql = "
	  insert into yabb_sys_server_type values (NULL,'{$TypeName}','{$TypeDesc}','{$CreateTime}')
	";
	$db = new DataBase();
	$db->execute($sql);
	
	echo '添加成功<br>';
	echo '<a href="form.php">返回</a>';
}else{
?>
<form method="post">
<table>
<tr>
<td align="right">分组名称：</td>
<td><input type="text" name="type_name"/></td>
</tr>
<tr>
<td align="right">分组描述：</td>
<td><textarea name="type_desc"></textarea></td>
</tr>
<tr>
<td align="right"></td>
<td>
<input type="submit"  name="submit" value="新增"/>
<input type="reset"  name="reset" value="取消"/>
</td>
</tr>
</table>
</form>
<?php }?>